<?php

/**
 * product actions.
 *
 * @package    tsantek-shop
 * @subpackage product
 * @author     Tomislav Šantek
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class productActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('product', 'show');
  }

  public function executeShow(sfWebRequest $request)
  {
      $slug = $request->getParameter('slug');
      $this->forward404If(($slug == null), 'Permalink proizvoda nije naveden.');

      $this->product = ProductTable::getInstance()->findOneBySlug($slug);
  }
}
